package com.itheima.springmvc.controller;

import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {

	@RequestMapping("/user/showlogin")
	public String showLogin(){
		return "login";
	}
	
	@RequestMapping("/user/login")
	public String userLogin(String username,String password,HttpSession session){
		System.out.println(username);
		System.out.println(password);
		session.setAttribute("username", username);
		session.setAttribute("password", password);
		session.setAttribute("test","test");

		session.setAttribute("test2","test2");
		session.setAttribute("test4","test4");
		session.setAttribute("test3","test3");
		session.setAttribute("test5","test5");
		session.setAttribute("test6","test6");
		return "redirect:/item/itemList.action";
	}
}
